package com.shenzhen.group.common.entity;

import com.shenzhen.group.common.card.Card;
import com.shenzhen.group.common.enumeration.CardColorEnum;

import javax.annotation.PostConstruct;
import java.util.List;

/**
 * 牌组父类
 *
 * @author 周赛波
 * @version v1.0.0
 * @date 2021/9/19 18:36
 */
public abstract class CardGroupBase {
    protected int num;
    protected String remark;
    protected List<Card> cards;

    public List<Card> getCards() {
        return cards;
    }

    public void initCards() {

    }

    protected void fillCard(boolean isKing) {
        for (int i = 1; i < 14; i++) {
            String show;
            switch (i) {
                case 1:
                    show = "A";
                    break;
                case 11:
                    show = "J";
                    break;
                case 12:
                    show = "Q";
                    break;
                case 13:
                    show = "K";
                    break;
                default:
                    show = String.valueOf(i);
            }
            cards.add(new Card(CardColorEnum.SPADE, i, CardColorEnum.SPADE.getShowInfo() + show));
            cards.add(new Card(CardColorEnum.HEART, i, CardColorEnum.HEART.getShowInfo() + show));
            cards.add(new Card(CardColorEnum.CLUB, i, CardColorEnum.CLUB.getShowInfo() + show));
            cards.add(new Card(CardColorEnum.DIAMOND, i, CardColorEnum.DIAMOND.getShowInfo() + show));
        }
        if (isKing) {
            cards.add(new Card(CardColorEnum.BIG_KING, Integer.MAX_VALUE, CardColorEnum.CLUB.getShowInfo()));
            cards.add(new Card(CardColorEnum.SMALL_KING, Integer.MAX_VALUE - 1, CardColorEnum.SPADE.getShowInfo()));
        }
    }

}
